<script type="text/javascript">
$(document).ready(function()
				{
    //text2 la cái class ở ctable
				$(".text2").blur(function(){
				    //1 cái ô
											$cellvalue = $(".cellvalue").val();
											$tong =$('.tong'+$(this).get(0).id).val();
											$value=$(this).val();
											$cellvalue = parseInt($cellvalue,10);
											$tong =parseInt($tong,10);
											$value=parseInt($value,10);
											if (isNaN($cellvalue))
												$cellvalue=0;
											if (isNaN($tong))
												$tong=0;
											if (isNaN($value))
											{
												$value=0;
												$(this).val(0);
											}
											$tong = $tong + $value - $cellvalue;
											$('.tong'+$(this).get(0).id).val($tong);
										});

				$(".text2").focus(function(){
					$(".cellvalue").val($(this).val());
				});
				
				$(".text1").keydown(function(e) {
			        if ( e.keyCode == 46 || e.keyCode == 8  || e.keyCode == 9) {}
			        else {
			            if (e.keyCode < 48 || e.keyCode > 57 ) {
			                e.preventDefault(); 
			            }   
			        }
			    });
				$(".text2").keydown(function(e) {
			        if (  e.keyCode == 8  || e.keyCode == 9) {}
			        else {
			            if (e.keyCode < 46 || e.keyCode > 57 ) {
			                e.preventDefault(); 
			            }   
			        }
			    });
				}
	);

</script>

<div class="kqbanhangs form">

<h3>Công việc theo kế hoạch tuần</h3>
<table><tr><th>(1)</th><th>(2)</th><th>(3)</th><th>(4)</th></tr>
<tr><td>Nhiệm vụ</td><td>Chỉ tiêu</td><td>Kết quả</td><td>% hoàn thành</td></tr></table>

<?php echo $this->Form->create('Nvngay',array('url'=>'luu/'.$kehoach.'/1'));?>
<?php   
   
    
    echo $ctable->Addtask('Nvngay',$nhanviens,1);
?>
<?php echo $this->Form->end(__('Lưu', true));?>

</div>